using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._ToRaster
{
    /// <summary>
    /// <para>Polyline to Raster</para>
    /// <para>Converts polyline features to a raster dataset.</para>
    /// <para>将折线要素转换为栅格数据集。</para>
    /// </summary>    
    [DisplayName("Polyline to Raster")]
    public class PolylineToRaster : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public PolylineToRaster()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The polyline input feature dataset to be converted to a raster.</para>
        /// <para>要转换为栅格的折线输入要素数据集。</para>
        /// </param>
        /// <param name="_value_field">
        /// <para>Value field</para>
        /// <para><xdoc>
        ///   <para>The field used to assign values to the output raster.</para>
        ///   <para>It can be any field of the input feature dataset's attribute table.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于为输出栅格分配值的字段。</para>
        ///   <para>它可以是输入要素数据集属性表的任意字段。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_rasterdataset">
        /// <para>Output Raster Dataset</para>
        /// <para><xdoc>
        ///   <para>The output raster dataset to be created.</para>
        ///   <para>If the output raster will not be saved to a geodatabase, specify .tif for TIFF file format, .CRF for CRF file format, .img for ERDAS IMAGINE file format, or no extension for Esri Grid raster format.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要创建的输出栅格数据集。</para>
        ///   <para>如果输出栅格不会保存到地理数据库中，请为 TIFF 文件格式指定 .tif 。CRF 表示 CRF 文件格式，.img 表示 ERDAS IMAGINE 文件格式，或者 Esri Grid 栅格格式没有扩展名。</para>
        /// </xdoc></para>
        /// </param>
        public PolylineToRaster(object _in_features, object _value_field, object _out_rasterdataset)
        {
            this._in_features = _in_features;
            this._value_field = _value_field;
            this._out_rasterdataset = _out_rasterdataset;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "Polyline to Raster";

        public override string CallName => "conversion.PolylineToRaster";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "outputCoordinateSystem", "pyramid", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_features, _value_field, _out_rasterdataset, _cell_assignment.GetGPValue(), _priority_field, _cellsize, _build_rat.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The polyline input feature dataset to be converted to a raster.</para>
        /// <para>要转换为栅格的折线输入要素数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Value field</para>
        /// <para><xdoc>
        ///   <para>The field used to assign values to the output raster.</para>
        ///   <para>It can be any field of the input feature dataset's attribute table.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于为输出栅格分配值的字段。</para>
        ///   <para>它可以是输入要素数据集属性表的任意字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _value_field { get; set; }


        /// <summary>
        /// <para>Output Raster Dataset</para>
        /// <para><xdoc>
        ///   <para>The output raster dataset to be created.</para>
        ///   <para>If the output raster will not be saved to a geodatabase, specify .tif for TIFF file format, .CRF for CRF file format, .img for ERDAS IMAGINE file format, or no extension for Esri Grid raster format.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要创建的输出栅格数据集。</para>
        ///   <para>如果输出栅格不会保存到地理数据库中，请为 TIFF 文件格式指定 .tif 。CRF 表示 CRF 文件格式，.img 表示 ERDAS IMAGINE 文件格式，或者 Esri Grid 栅格格式没有扩展名。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_rasterdataset { get; set; }


        /// <summary>
        /// <para>Cell assignment type</para>
        /// <para><xdoc>
        ///   <para>The method to determine how the cell will be assigned a value when more than one feature falls within a cell.</para>
        ///   <bulletList>
        ///     <bullet_item>Maximum length—The feature with the longest length that covers the cell will determine the value to assign to the cell.</bullet_item><para/>
        ///     <bullet_item>Maximum combined length—If there is more than one feature in a cell with the same value, the lengths of these features will be combined. The combined feature with the longest length within the cell will determine the value to assign to the cell.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定当多个要素位于一个单元格中时如何为单元格分配值的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>最大长度 - 覆盖像元长度最长的要素将确定要分配给像元的值。</bullet_item><para/>
        ///     <bullet_item>最大组合长度 - 如果单元格中有多个具有相同值的要素，则这些要素的长度将被合并。单元格内长度最长的组合要素将确定要分配给单元格的值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Cell assignment type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _cell_assignment_value _cell_assignment { get; set; } = _cell_assignment_value._MAXIMUM_LENGTH;

        public enum _cell_assignment_value
        {
            /// <summary>
            /// <para>Maximum length</para>
            /// <para>Maximum length—The feature with the longest length that covers the cell will determine the value to assign to the cell.</para>
            /// <para>最大长度 - 覆盖像元长度最长的要素将确定要分配给像元的值。</para>
            /// </summary>
            [Description("Maximum length")]
            [GPEnumValue("MAXIMUM_LENGTH")]
            _MAXIMUM_LENGTH,

            /// <summary>
            /// <para>Maximum combined length</para>
            /// <para>Maximum combined length—If there is more than one feature in a cell with the same value, the lengths of these features will be combined. The combined feature with the longest length within the cell will determine the value to assign to the cell.</para>
            /// <para>最大组合长度 - 如果单元格中有多个具有相同值的要素，则这些要素的长度将被合并。单元格内长度最长的组合要素将确定要分配给单元格的值。</para>
            /// </summary>
            [Description("Maximum combined length")]
            [GPEnumValue("MAXIMUM_COMBINED_LENGTH")]
            _MAXIMUM_COMBINED_LENGTH,

        }

        /// <summary>
        /// <para>Priority field</para>
        /// <para>This field is used to determine which feature should take preference over another feature that falls over a cell. When it is used, the feature with the largest positive priority is always selected for conversion irrespective of the Cell assignment type chosen.</para>
        /// <para>此字段用于确定哪个要素应优先于位于单元格上的另一个要素。使用时，无论选择的单元分配类型如何，始终选择具有最大正优先级的特征进行转换。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Priority field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _priority_field { get; set; } = null;


        /// <summary>
        /// <para>Cellsize</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster being created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn’t been explicitly specified as the parameter value, the environment cell size value is used, if specified; otherwise, additional rules are used to calculate it from the other inputs. See Usages for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>正在创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未显式指定像元大小作为参数值，则使用环境像元大小值（如果已指定）;否则，将使用其他规则从其他输入中计算它。有关详细信息，请参阅用法。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Cellsize")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cellsize { get; set; } = null;


        /// <summary>
        /// <para>Build raster attribute table</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output raster will have a raster attribute table.</para>
        ///   <para>This parameter only applies to integer rasters.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The output raster will have a raster attribute table. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The output raster will not have a raster attribute table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出栅格是否具有栅格属性表。</para>
        ///   <para>此参数仅适用于整数栅格。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 输出栅格将具有栅格属性表。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 输出栅格将不具有栅格属性表。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Build raster attribute table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _build_rat_value _build_rat { get; set; } = _build_rat_value._true;

        public enum _build_rat_value
        {
            /// <summary>
            /// <para>BUILD</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("BUILD")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_BUILD</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_BUILD")]
            [GPEnumValue("false")]
            _false,

        }

        public PolylineToRaster SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object pyramid = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, pyramid: pyramid, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}